-
Notifications
You must be signed in to change notification settings - Fork 548
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Suppress errors on RuboCop 0.50.0 & Ruby 3.1+ #1256
Suppress errors on RuboCop 0.50.0 & Ruby 3.1+ #1256
Conversation
This change suppresses the following error: ``` $ bundle exec rubocop Inspecting 36 files ...............An error occurred while Lint/BlockAlignment cop was inspecting /build/lib/mysql2/console.rb:3:20. To see the complete backtrace run rubocop -d. ..................An error occurred while Lint/BlockAlignment cop was inspecting /build/tasks/generate.rake:1:0. To see the complete backtrace run rubocop -d. ... 36 files inspected, no offenses detected 2 errors occurred: An error occurred while Lint/BlockAlignment cop was inspecting /build/lib/mysql2/console.rb:3:20. An error occurred while Lint/BlockAlignment cop was inspecting /build/tasks/generate.rake:1:0. Errors are usually caused by RuboCop bugs. Please, report your problems to RuboCop's issue tracker. Mention the following information in the issue report: 0.50.0 (using Parser 2.7.2.0, running on ruby 3.1.0 x86_64-linux) ```
I'd rather update Rubocop. Is there less-recent version that spans the same Ruby support window? If not, it's on the list of reasons to drop Ruby 2.0 soon. |
No, RuboCop v0.50.0 is the final version to support Ruby 2.0. I've found that RuboCop v0.49.1 does not raise errors,
So is it time to move forward with #917 and drop support for Ruby 2.0? |
As you may know, there is a way to use a specific rubocop version conditionally for each Ruby version in Lines 5 to 9 in ffdd8c6
|
Yeah, but unfortunately,
Until now, when the Runtime version of RuboCop was bumped,
In the future, it's likely that the latest RuboCop will be able to parse Ruby 2.0 code. |
@mishina2228 RuboCop 1.13 has been released that can analyze code from Ruby 2.0 to 3.1 (and 3.2 is an experimental). The runtime Ruby version requires Ruby 2.6 or higher. https://github.com/rubocop/rubocop/releases/tag/v1.30.0 |
Thank you @koic ! |
#1268 will fix the errors. So I close this PR. |
This PR suppress errors on RuboCop 0.50.0 & Ruby 3.1+.
RuboCop raises errors in
fedora fedora:rawhide
workflow.https://github.com/brianmario/mysql2/runs/6070946568?check_suite_focus=true
The latest RuboCop (v1.27.0) with Ruby 3.1 does not raise the error.
But this gem still supports Ruby 2.0, so we can't update RuboCop.
That's why I just excluded files that caused the error.